package com.szeldon.pj.jps.exp;

import com.szeldon.pj.jps.datastore.SimpleObject;
import com.szeldon.pj.jps.visitor.Visitor;

public abstract class Expression {

	public void accept(Visitor visitor) {
		visitor.accept(this);
	}

	/**
	 * Returns -1 when this object is smaller than given one. 0 when they're equal. 1 when given object is smaller.
	 * 
	 * @param object
	 * @return
	 * @throws IllegalStateException
	 *             Thrown when this object and given one aren't comparable.
	 */
	public abstract int compareTo(SimpleObject object) throws IllegalStateException;
	
	public abstract String getValueAsString();
}
